package com.hnkywl.sts.webservice.bg.util;

import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;

import sun.misc.BASE64Decoder;

@SuppressWarnings("restriction")
public class Key
{

    public Key()
    {
    }

    public static SecretKey loadKey()
        throws Exception
    {
        SecretKey key = null;
       String fis ="nnnsidedishprovide";
        if(fis != null)
        {
            BASE64Decoder d = new BASE64Decoder();
            byte b[] = d.decodeBuffer(fis);
            DESKeySpec dks = new DESKeySpec(b);
            SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
            key = keyFactory.generateSecret(dks);
        }
        return key;
    }
}